package com.vs.wms.dwr;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.vs.wms.common.CommonDao;
import com.vs.wms.pojo.ResultData;
import com.vs.wms.pojo.SysFunction;
import com.vs.wms.pojo.User;

public class DwrTest extends CommonDao {

	@SuppressWarnings("unchecked")
	public ResultData<User> getResult() {
		
		List<User> lstUser = new ArrayList<User>();
		
		try {
			
			lstUser = sqlMap.queryForList("UserInfo.getUsers", new User());
		} catch (SQLException e) {
			
			e.printStackTrace();
		}
		
		return new ResultData<User>(lstUser.size(), lstUser);
	}
	
	@SuppressWarnings("unchecked")
	public ResultData<SysFunction> getSysFuntions() {
		
		List<SysFunction> lstSysFun = new ArrayList<SysFunction>();
		
		try {
			
			lstSysFun = sqlMap.queryForList("SysFunction.getSysFunName", new SysFunction());
		} catch (SQLException e) {
			
			e.printStackTrace();
		}
		
		return new ResultData<SysFunction>(lstSysFun.size(), lstSysFun);
	}
}
